<?php

$buttonName = '开始预订';
$bookItem = new BWInputValue($bookingId);
$bookList = new BTreeList($bookItem);
$htmlOptions = array(
    'enctype' => 'multipart/form-data',
    'class' => 'ui-btn btn-info ui-btn-corner-all ui-mini'
);
$addToBookingCartTimeItem = $bookList->getItem('addToBookingCartTime');
if ($addToBookingCartTimeItem instanceof BTreeItem) {
    $addToBookingCartTime = $addToBookingCartTimeItem->value;
    if ($addToBookingCartTime + 15 * 60 > time()) {
        $buttonName = $buttonName = '正在预订';
        $htmlOptions['class'] = 'ui-btn btn-success ui-btn-corner-all ui-mini diabled';
        $htmlOptions['disabled'] = 'true';
    }
}

echo $control->getLink(array('name' => $buttonName, 'id' => 'showAddBooking1'), array(
    'bookingId' => $bookingId,
    //'bookableId' => $bookable->getId(),
    //'ajaxContainerId' => 'myModal',
    'ajaxContainerId' => 'myModal',
    'htmlOptions' => $htmlOptions,
    'ajaxOptions' => array(
        'complete' => 'function(){$("#ajax-loaderdiv").hide();$("#myModal").modal("show");}')
));
?>